
#include "optionswidget.h"
#include "filetable.h"
#include "slepui.h"


void OptionsWidget::setOPTS_init(int init){
    opts->init = init;
}

void OptionsWidget::setOPTS_lFlag(int lFlag){
    opts->lFlag = lFlag;
}

void OptionsWidget::setOPTS_mFlag(int mFlag){
    opts->mFlag = mFlag;
}

void OptionsWidget::setOPTS_nFlag(int nFlag){
    opts->nFlag = nFlag;
}

void OptionsWidget::setOPTS_tFlag(int tFlag){
    opts->tFlag = tFlag;
}

void OptionsWidget::setOPTS_maxIter(int maxIter){
    opts->maxIter = maxIter;
}

void OptionsWidget::setOPTS_tol(double tol){

    opts->REGISTER = (OPTS_REGISTRY)((opts->REGISTER) | SlepOPT_tol);
    opts->tol = tol;
}


void OptionsWidget::setOPTS_rFlag(int rFlag){
    opts->rFlag = rFlag;
}


void OptionsWidget::setOPTS_rsL2(double rsL2){
    if(rsL2 != 0.0){
        opts->rsL2 = rsL2;
        setREGISTER(opts,SlepOPT_rsL2);
    }else{
        opts->rsL2 = 0.0;
        unsetREGISTER(opts,SlepOPT_rsL2);
    }
}


void OptionsWidget::setOPTS_sWeight1(double sWeight1){
	opts->sWeight[0] = sWeight1;
	setREGISTER(opts,SlepOPT_sWeight);
}

void OptionsWidget::setOPTS_sWeight2(double sWeight2){
	opts->sWeight[1] = sWeight2;
	setREGISTER(opts,SlepOPT_sWeight);
}



void OptionsWidget::setOPTS_c0(double c0){
	opts->REGISTER = (OPTS_REGISTRY)((opts->REGISTER) | SlepOPT_c0);
    *(opts->c0->data.vctr) = c0;
}


void OptionsWidget::setOPTS_c0_v(void *c0_v){
	opts->REGISTER = (OPTS_REGISTRY)((opts->REGISTER) | SlepOPT_c0);
	itemC0Vector = (SLEPItem*)c0_v;
}


void OptionsWidget::setOPTS_x0(void *x0){
	opts->REGISTER = (OPTS_REGISTRY)((opts->REGISTER) | SlepOPT_x0);
	itemx0 = (SLEPItem*)x0;
}


void OptionsWidget::setOPTS_X0(void *X0){
	opts->REGISTER = (OPTS_REGISTRY)((opts->REGISTER) | SlepOPT_X0);
	itemX0 = (SLEPItem*) X0;
}

